<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${node.name}[#if
	node.parent??]_${node.parent.name}[/#if]_${site.fullNameOrName}${global.customs['poweredby']}</title>
<link href="_files/css.css" rel="stylesheet" />
<link href="_files/fuchuang.css" rel="stylesheet" />
[#include 'inc_js.html'/]
<script language="javascript" type="text/javascript" src="_files/js/line.js"></script>
<script>
$(function() {
	var url = location.search;
	url = url.substring(url.lastIndexOf("=")+1,url.length);
	
	$.ajax({
		type : 'get',
// 		async : false,
		url : '${ctx}/ext/line.htmx?lineId=2',
		dataType : 'json',
		error : function() {
			alert('系统连接失败，请稍后再试！');
		},
		success : function(result) {
			if (result.info.success){
				if (result.data != null && result.data.length > 0) {
					for (var i = 0; i < result.data.length; i++) {
						var stations = result.data[i].stations;
						var lineId = result.data[i].id;
						var lineName = result.data[i].name;
						$.each(stations,function(key,value){
							var stationId = value.id;
							var stationName = value.name;
							$("#zdcx").append("<a id='"+ stationId+ "' onclick=\"scheduleQuery('"+ stationId + "','"+ stations.length + "');\">"+stationName+"</a>");
						})
						if(url != ""){
							scheduleQuery(url,stations.length);
						}else{
							scheduleQuery(1,stations.length);
						}
						
					}
				}
			}
		}
	});
});
function scheduleQuery(startId, length){
	for(var i=1;i<=length;i++){
		$("#"+i).removeClass("selected06");;
	}
	$("#"+startId).addClass("selected06");;
	$("#scheduleTable").empty();
	var timeHtml="";
	$.ajax({
		url : "${ctx}/ext/schedule.htmx?stationId="+startId,
		type : 'GET',
		async : false,
		error : function() {
			alert('系统连接失败，请稍后再试！');
		},
		success : function(result) {
			if (result.info.success) {
				if (result.data != null && result.data.length > 0) {
					for (var i = 0; i < result.data.length; i++) {
						var tmpDate = result.data[i];
						timeHtml+="<table class=\"yunyingshijian-table\">";
					         timeHtml+="<tr class=\"yysj-leibie\">";
					          timeHtml+="<th>运营时间表（其他工作日）</th>";
					         timeHtml+="</tr>";
					         timeHtml+="<tr class=\"yysj-table-list\">";
					          timeHtml+="<td class=\"yysj-td01 color-red\">方向</td>";
					          timeHtml+="<td class=\"yysj-td03 color-red\">首班车</td>";
					          timeHtml+="<td class=\"yysj-td03 color-red\">末班车</td>";
					          timeHtml+="<td class=\"yysj-td03 color-red\">所属线路</td>";
					         timeHtml+="</tr>";
					         timeHtml+="<tr class=\"yysj-table-list\">";
					          timeHtml+="<td class=\"yysj-td01\">"+tmpDate.toDirection+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.workdayStartTo+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.workdayEndTo+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.line.name+"</td>";
					         timeHtml+="</tr>";
					         timeHtml+="<tr class=\"yysj-table-list\">";
					          timeHtml+="<td class=\"yysj-td01\">"+tmpDate.comeDirection+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.workdayStartCome+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.workdayEndCome+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.line.name+"</td>";
					         timeHtml+="</tr>";   
					        timeHtml+="</table>";
					        timeHtml+="<table class=\"yunyingshijian-table\">";
					         timeHtml+="<tr class=\"yysj-leibie\">";
					          timeHtml+="<th>运营时间表（节假日）</th>";
					         timeHtml+="</tr>";
					         timeHtml+="<tr class=\"yysj-table-list\">";
					          timeHtml+="<td class=\"yysj-td01 color-red\">方向</td>";
					          timeHtml+="<td class=\"yysj-td03 color-red\">首班车</td>";
					          timeHtml+="<td class=\"yysj-td03 color-red\">末班车</td>";
					          timeHtml+="<td class=\"yysj-td03 color-red\">所属线路</td>";
					         timeHtml+="</tr>";
					         timeHtml+="<tr class=\"yysj-table-list\">";
					          timeHtml+="<td class=\"yysj-td01\">"+tmpDate.toDirection+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.holidayStartTo+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.holidayEndTo+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.line.name+"</td>";
					         timeHtml+="</tr>";
					         timeHtml+="<tr class=\"yysj-table-list\">";
					          timeHtml+="<td class=\"yysj-td01\">"+tmpDate.comeDirection+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.holidayStartCome+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.holidayEndCome+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.line.name+"</td>";
					         timeHtml+="</tr>";   
					        timeHtml+="</table>";
					        timeHtml+="<table class=\"yunyingshijian-table\">";
					         timeHtml+="<tr class=\"yysj-leibie\">";
					          timeHtml+="<th>运营时间表（节假日前一天工作日）</th>";
					         timeHtml+="</tr>";
					         timeHtml+="<tr class=\"yysj-table-list\">";
					          timeHtml+="<td class=\"yysj-td01 color-red\">方向</td>";
					          timeHtml+="<td class=\"yysj-td03 color-red\">首班车</td>";
					          timeHtml+="<td class=\"yysj-td03 color-red\">末班车</td>";
					          timeHtml+="<td class=\"yysj-td03 color-red\">所属线路</td>";
					         timeHtml+="</tr>";
					         timeHtml+="<tr class=\"yysj-table-list\">";
					          timeHtml+="<td class=\"yysj-td01\">"+tmpDate.toDirection+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.otherStartTo+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.otherEndTo+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.line.name+"</td>";
					         timeHtml+="</tr>";
					         timeHtml+="<tr class=\"yysj-table-list\">";
					          timeHtml+="<td class=\"yysj-td01\">"+tmpDate.comeDirection+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.otherStartCome+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.otherEndCome+"</td>";
					          timeHtml+="<td class=\"yysj-td03\">"+tmpDate.line.name+"</td>";
					         timeHtml+="</tr>";   
					        timeHtml+="</table>";
					}
				}
			}
		}
	});
	$("#scheduleTable").append(timeHtml);
}
</script>					
</head>

<body>
  <div class="top-bg-01">
    <div id="main"> 
      <!--头部-->
      [#include 'inc_header.html'/]
			<div class="lianjie-index">
				你当前的位置： [#list node.hierarchy as n]<a
					href="${n.url}" class="a c-desc">${n.name}</a>[#if n_has_next] >
				[/#if][/#list]
			</div>
      <div class="main-main">
       <div id="left-menu">[#include 'level_second_leftMenu.html'/]</div>
       <div class="list-right">
        <div class="list-right-shang">
         <div class="xianlu-qk">
          <div class="xianlu-xz">
           <b class="xianlu-qk-title color-02 "><img src="_files/img/list-icon-whole.png" width="6" height="8" style="margin-right:6px;">2号线</b>
<!--            <b class="xianlu-qk-title color-03 selected-2"><img src="_files/img/list-icon-whole.png" width="6" height="8" style="margin-right:6px;">3号线</b> -->
          </div>
          <p class="zdcx-stations02 float-left" id='zdcx'> </p>
          <div id="scheduleTable"></div>
         </div>
         
        </div>
        </div>
       </div>
        <div class="clearboth"></div>
        <!--footer-->
    	[#include 'inc_footer.html'/]
 	  	<!--footer-end-->
      </div>
     
    </div>
</body>
</html>